package com.bright.hxj.cwduijie.repository;

import com.bright.hxj.cwduijie.pojo.po.FixedAssetsInfoChange;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface FixedAssetsInfoChangeRepository extends JpaRepository<FixedAssetsInfoChange, Integer>, JpaSpecificationExecutor<FixedAssetsInfoChange> {
    List<FixedAssetsInfoChange> getBySjjhbz(int sjjhbz);

    @Query("select TYSHXYDM from FixedAssetsInfoChange where sjjhbz=:sjjhbz group by TYSHXYDM")
    List<String> getDistinctTYSHXYDMBySjjhbz(@Param("sjjhbz") int sjjhbz);

    @Query("from FixedAssetsInfoChange where sjjhbz=:sjjhbz and ZT_DATA_KEY like :ztDataKey%")
    List<FixedAssetsInfoChange> getBySjjhbzAndZtDataKey(@Param("sjjhbz") int sjjhbz, @Param("ztDataKey") String ztDataKey);
}